package com.bigdata.core.action

import org.apache.spark.rdd.RDD
import org.apache.spark.{SparkConf, SparkContext}

/**
 * first  取出第一个元素
 */
object Demo5_first {
  def main(args: Array[String]): Unit = {
    val conf = new SparkConf().setMaster("local").setAppName("first")
    val sc = new SparkContext(conf)
    sc.setLogLevel("error")

    val lines: RDD[String] = sc.textFile("./data/words")

    val str = lines.first()
    println(str)

  }
}
